<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>IYUU浏览器助手</title>
    <link rel="stylesheet" href="/assets/layui/css/layui.css">
    <link rel="stylesheet" href="popup.css">
</head>
<body>
<div class="layui-container">
    <div class="layui-tab layui-tab-brief" lay-filter="action_popup">
        <ul class="layui-tab-title">
            <li class="layui-this" lay-id="sites"><i class="layui-icon layui-icon-website"></i> 站点</li>
            <li lay-id="test"><i class="layui-icon layui-icon-app"></i> 测试</li>
            <li lay-id="settings"><i class="layui-icon layui-icon-set-fill"></i> 设置</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <button type="button" class="layui-btn layui-btn-sm layui-btn-radius layui-bg-blue" lay-on="getRequest">
                    拉取站点
                </button>
                <button type="button" class="layui-btn layui-btn-sm layui-btn-radius layui-bg-purple"
                        lay-on="refreshAll">
                    刷新全部
                </button>
                <button type="button" class="layui-btn layui-btn-sm layui-btn-radius layui-bg-purple"
                        lay-on="openOptionsPage">扩展选项
                </button>
                <button type="button" class="layui-btn layui-btn-sm layui-btn-radius layui-bg-orange" lay-on="reload">
                    重载插件
                </button>
                <table class="layui-table" lay-size="sm" lay-even="true">
                    <colgroup>
                        <col class="index">
                        <col class="sid">
                        <col class="site">
                        <col>
                        <col class="status">
                        <col class="status">
                        <col class="action">
                    </colgroup>
                    <thead>
                    <tr class="layui-bg-gray">
                        <th>序号</th>
                        <th>站点ID</th>
                        <th>站点名称</th>
                        <th>昵称</th>
                        <th>Cookie</th>
                        <th>登录状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody id="sites_tbody">
                    </tbody>
                </table>
            </div>
            <div class="layui-tab-item">
                <button type="button" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-primary layui-border"
                        lay-on="createSiteTab"
                        data-site="m-team">
                    <i class="layui-icon layui-icon-website"></i> 创建标签
                </button>
                <form class="layui-hide">
                    <label for="upload_sites_json_file">选择文件:</label>
                    <input type="file" name="file" accept="application/json" id="upload_sites_json_file">
                </form>
                <button type="button" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-primary layui-border"
                        id="upload_sites_json">
                    <i class="layui-icon layui-icon-upload"></i> 恢复站点
                </button>
                <button type="button" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-primary layui-border"
                        lay-on="openPopup">
                    <i class="layui-icon layui-icon-tabs"></i>  打开Popup
                </button>
                <button type="button" class="layui-btn layui-btn-sm layui-btn-radius layui-btn-primary layui-border"
                        lay-on="updatePopup">
                    <i class="layui-icon layui-icon-set-fill"></i> 切换Popup
                </button>
                <button type="button" class="layui-btn layui-btn-sm layui-btn-radius layui-bg-purple"
                        lay-on="createTab">
                    <i class="layui-icon layui-icon-home"></i> 爱语飞飞
                </button>
                <button type="button" class="layui-btn layui-btn-sm layui-btn-radius layui-bg-red" lay-on="clear">
                    <i class="layui-icon layui-icon-delete"></i> 清理缓存
                </button>
            </div>
            <div class="layui-tab-item">
                <form class="layui-form" action="" lay-filter="setting_filter">
                    <div class="layui-form-item">
                        <label class="layui-form-label required" for="iyuu_helper_server">助手地址</label>
                        <div class="layui-input-block">
                            <input type="text" name="iyuu_helper_server" placeholder="请输入IYUU助手服务器地址"
                                   autocomplete="off"
                                   class="layui-input" id="iyuu_helper_server">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" for="iyuu_helper_secret">助手密钥</label>
                        <div class="layui-input-block">
                            <input type="password" name="iyuu_helper_secret" placeholder="请输入IYUU助手服务器密钥（地址包含密钥，保存时会自动填写）"
                                   autocomplete="off"
                                   class="layui-input" id="iyuu_helper_secret">
                            <div class="layui-input-affix layui-input-suffix">
                                <i class="layui-icon layui-icon-eye-invisible" id="showPassword"></i>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button type="submit" class="layui-btn layui-btn-sm" lay-submit lay-filter="save_config">
                                <i class="layui-icon layui-icon-form"></i> 立即保存
                            </button>
                            <button type="button" class="layui-btn layui-btn-sm layui-btn-primary layui-border-purple"
                                    lay-on="backupConfig">
                                <i class="layui-icon layui-icon-export"></i> 备份设置
                            </button>
                            <button type="button" class="layui-btn layui-btn-sm layui-btn-primary layui-border-purple"
                                    lay-on="recoveryConfig" title="请选择一个 JSON 文件进行上传">
                                <i class="layui-icon layui-icon-upload"></i> 恢复设置
                            </button>
                        </div>
                    </div>
                </form>
                <form class="layui-hide">
                    <label for="recoveryConfig">选择文件:</label>
                    <input type="file" name="file" accept="application/json" id="recoveryConfig"
                           title="请选择一个 JSON 文件进行上传" placeholder="点击选择文件">
                </form>
            </div>
        </div>
    </div>
</div>

<script src="/assets/layui/layui.js"></script>
<script src="/assets/functions.js"></script>
<script src="aes.js" type="module"></script>
<script src="popup.js" type="module"></script>
<script src="setting.js" type="module"></script>
<script src="table.js" type="module"></script>
<script src="upload.js" type="module"></script>
</body>
</html>